const TokenKey = 'X-Litemall-Admin-Token'
const userId = 'userId'
const shopId = 'shopId'

export function getID() {
  return localStorage.getItem(userId)
}

export function getShopID() {
  return parseInt(localStorage.getItem(shopId))
}

export function getToken() {
  return localStorage.getItem(TokenKey)
}

export function setToken(token) {
  return localStorage.setItem(TokenKey, token)
}

export function setID(id) {
  return localStorage.setItem(userId, id)
}

export function setShopID(id) {
  return localStorage.setItem(shopId, id)
}

export function removeToken() {
  return localStorage.removeItem(TokenKey)
}

export function setShopList(vm, item) {
  return localStorage.setItem('shopList', vm.$ed(item))
}

export function removeShopList(vm) {
  return localStorage.removeItem('shopList')
}

export function getShopList(vm) {
  return vm.$dd(localStorage.getItem('shopList'))
}
